package com.kjtpay.design_pattern.state;

class Work {
    public State current;
    public Integer hour;
    public Integer minute;
    public Boolean finish;

    public Work() {
        // 初始为上午工作状态；如果没有初始状态，就无法启动流转
        current = new ForenoonState();
    }

    // Context中的request()，这里和state中的handle()方法用了同样的名字
    public void writeProgram() {
        current.writeProgram(this);
    }
}
